<template>
  <div>
    当前数值：{{$store.state.count}}<br>
    <button @click="increase">+</button>
    <button @click="decrease">-</button>
    {{$store.getters.val}}
  </div>
</template>

<script>
  import * as Types from '../store/mutations-type'
  export default {
    data () {
      return {}
    },
    methods: {
      increase(){
        this.$store.commit(Types.INCREMENT,2)//会自动去找mutation中的increase
      },
      decrease(){
        this.$store.commit(Types.DECTEMENT)
      }
    },
    computed: {},
    components: {}
  }
</script>

<style scoped>

</style>
